package qunar;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class NewTest {

    public static final InheritableThreadLocal<String> inheritableThreadLocal = new InheritableThreadLocal<>();
    public static final ThreadLocal<String> threadLocal = new ThreadLocal<>();
    public static final ExecutorService EXECUTOR_SERVICE = Executors.newFixedThreadPool(10);

    public static void main(String[] args) {
        inheritableThreadLocal.set("Inheritable hello");
//        threadLocal.set("hello");

        EXECUTOR_SERVICE.execute(()->{
            System.out.println(String.format("11111子线程可继承值：%s", inheritableThreadLocal.get()));
//            System.out.println(String.format("111111子线程值：%s", threadLocal.get()));
        });

    }
}
